Number comparison is a very common activity in programming tasks. Typically, computers keep integers in 2's complement form and decimal numbers in IEEE standard 754. In existing comparison method, each number need to be converted into integer or decimal numbers as maintained in computer before comparison. For example, integer conversion is done by traversing through the digits from the beginning and multiplying the converted part by 10 and then adding the product with the next digit which then becomes converted part for next iteration.
As explained above, it takes time to convert numbers, e.g. ASCII codes, into a computer based number format in the existing comparison method. However, in certain functional areas such as stream processing where available time to process individual records is very less, typically a few milliseconds, e.g. 1-5 milliseconds. For example, during a telecom call detail record processing, a common requirement is to know which operators do the calling and called number belong to. Since mobile number portability is in use in many countries, it is not possible to identify operators by checking whether the mobile number belongs to a particular block. Typically, a large number of blocks are to be checked for this purpose. Since the ranges are too numerous, e.g. 500,000 blocks for a country like Netherlands, it is not convenient to load these entirely in computer memory. A frequently used approach for this kind of search is to decide a coarse block from memory based search and then do a record by record search within the bigger block in hard disk. Traditionally, the input number is checked with start of the range and end of the range. If it falls in between, the operator ID is picked up from this record. Since master files with ranges are generally made available by public agencies for diverse use, they encode the start and end of range using human readable ASCII character codes. Commonly, the input number, start of the range and end of the range are first converted from ASCII to numbers, as maintained in computer, and then two simple number comparisons are done.
It is therefore desirable to provide a comparison method faster than the existing method, especially when the numbers are very big.